const Router = require('koa-router')

const router = new Router({ prefix: '/home' })

const service = require('../service/home_service')

// Home页推荐页面
router.get('/swiper', async (ctx, next) => {
  console.log('获取轮播图');
  const result = await service.getHomeSwiper()
  ctx.response.body = result
})
router.get('/recart', async (ctx, next) => {
  console.log('获取首页推荐文章');
  const result = await service.getRecommendArticles()
  ctx.response.body = result
})
router.get('/nrecart', async (ctx, next) => {
  console.log('获取最新的文章');
  const result = await service.getNewRecommendArticles()
  ctx.response.body = result
})

// Home页Pc游戏页面
router.get('/pcgametags', (ctx, next) => {
  console.log('获取PC游戏页面顶部tags');
  ctx.response.body = {
    title: 'PC游戏社区',
    bgcImgUrl: "../../../public/img/PcGameLink/1646641675458.png",
    iconUrl: "../../../public/img/PcGameLink/1646641670563.png",
    tagsTitle: ['PC玩家交流', '攻略', '同人分享']
  }
})
router.get('/pcgameart', (ctx, next) => {
  console.log('获取PC游戏文章');
  ctx.response.body = [{
    title: '《艾尔登法环》帮你不迷路第一期：史东薇尔城篇',
    id: 2000,
    date: '1分钟前',
    tag: '江南高质量糖纸',
    comment: 178,
    imgUrl: '../../../../public/img/PcGame/1646639925664.png'
  }, {
    title: '华纳游戏《哥谭骑士》现已上架steam',
    id: 2001,
    date: '2分钟前',
    tag: '游戏资讯BOT',
    comment: 18,
    imgUrl: '../../../../public/img/PcGame/1646639912552.png'
  }, {
    title: '《游戏NOBA》H&K公司枪械大盘点——HK416',
    id: 2002,
    date: '3分钟前',
    tag: '伦敦上空的莫斯科',
    comment: 67,
    imgUrl: '../../../../public/img/PcGame/1646639904086.png'
  }, {
    title: '星露谷那些整蛊搞怪的好玩模组盘点',
    id: 2003,
    date: '5分钟前',
    tag: '流木和小羊',
    comment: 105,
    imgUrl: '../../../../public/img/PcGame/1646639896696.png'
  }, {
    title: '《影子武士3》：刺激爽快的饕餮盛宴',
    id: 2004,
    date: '6分钟前',
    tag: '野哉诸人',
    comment: 32,
    imgUrl: '../../../../public/img/PcGame/1646639888860.png'
  }, {
    title: '两块古板老石头，撞出绚烂新火花《全面战争：战锤3》',
    id: 2005,
    date: '7分钟前',
    tag: '夜游者',
    comment: 66,
    imgUrl: '../../../../public/img/PcGame/1646639880985.png'
  }, {
    title: '《极限竞速：地平线5》S5夏季奖励一览',
    id: 2006,
    date: '9分钟前',
    tag: 'Gawaine',
    comment: 23,
    imgUrl: '../../../../public/img/PcGame/1646639854983.png'
  },]
})
router.get('/npcgameart', (ctx, next) => {
  console.log('获取最新PC游戏文章');
  ctx.response.body = [{
    title: '《英灵殿》全新DLC“末日曙光”10号解锁！',
    id: 2007,
    date: '1分钟前',
    tag: 'GAMER推荐',
    comment: 178,
    imgUrl: '../../../../public/img/PcGame/1646640528103.png'
  }]
})

// Home页主机游戏页面
router.get('/consolegametags', (ctx, next) => {
  console.log('获取主机游戏页面顶部tags');
  ctx.response.body = {
    title: '主机游戏社区',
    bgcImgUrl: "../../../public/img/ConsoleGameLink/1646645095200.png",
    iconUrl: "../../../public/img/ConsoleGameLink/1646645100313.png",
    tagsTitle: ['主机同好会', '独占', '3A大作']
  }
})
router.get('/consolegameart', (ctx, next) => {
  console.log('获取主机游戏文章');
  ctx.response.body = [{
    title: '《星之卡比：探索发现》评级显示含轻微恐怖元素',
    id: 3000,
    date: '1分钟前',
    tag: 'Switch资讯BOT',
    comment: 11,
    imgUrl: '../../../../public/img/ConsoleGame/1646656854003.png'
  }, {
    title: '索尼PS5国行今日行情4148元，微软XSX国行今日行情5383元',
    id: 3001,
    date: '2分钟前',
    tag: 'feichenpan',
    comment: 23,
    imgUrl: '../../../../public/img/ConsoleGame/1646656858799.png'
  }, {
    title: '【NS好价日报】《火爆狂飙》《我的阴暗面》折扣中',
    id: 3002,
    date: '3分钟前',
    tag: 'Switch情报官',
    comment: 12,
    imgUrl: '../../../../public/img/ConsoleGame/1646656863368.png'
  }, {
    title: '马力欧日即将到来！美服Eshop开启打折',
    id: 3003,
    date: '5分钟前',
    tag: 'Switch资讯BOT',
    comment: 69,
    imgUrl: '../../../../public/img/ConsoleGame/1646656870022.png'
  }, {
    title: '《幽灵线：东京》PS5版预购奖励公布',
    id: 3004,
    date: '6分钟前',
    tag: '游戏资讯BOT',
    comment: 13,
    imgUrl: '../../../../public/img/ConsoleGame/1646656870034.png'
  }, {
    title: '日本TSUTAYA游戏周销榜：NS《三角战略》登顶',
    id: 3005,
    date: '7分钟前',
    tag: 'Switch资讯BOT',
    comment: 30,
    imgUrl: '../../../../public/img/ConsoleGame/1646656875970.png'
  }, {
    title: '《灵魂骇客2》最新游戏截图公开，8月25日发售',
    id: 3006,
    date: '9分钟前',
    tag: '游戏资讯BOT',
    comment: 3,
    imgUrl: '../../../../public/img/ConsoleGame/1646656879863.png'
  },]
})
router.get('/nconsolegameart', (ctx, next) => {
  console.log('获取最新主机游戏文章');
  ctx.response.body = [{
    title: '《糖豆人》和《宇宙机器人》宣布联动！',
    id: 3007,
    date: '1分钟前',
    tag: '游戏资讯BOT',
    comment: 6,
    imgUrl: '../../../../public/img/ConsoleGame/1646657177745.png'
  }]
})

// Home页手机游戏页面
router.get('/mobilegametags', (ctx, next) => {
  console.log('获取手机游戏页面顶部tags');
  ctx.response.body = {
    title: '手机游戏社区',
    bgcImgUrl: "../../../public/img/MobileGameLink/1646657517875.png",
    iconUrl: "../../../public/img/MobileGameLink/1646657513631.png",
    tagsTitle: ['休闲', '移动', '碎片时间']
  }
})
router.get('/mobilegameart', (ctx, next) => {
  console.log('获取手机游戏文章');
  ctx.response.body = [{
    title: '⌈决胜小丘郡郊野⌋ 剿灭作战竞速活动',
    id: 4000,
    date: '1分钟前',
    tag: '手游资讯BOT',
    comment: 38,
    imgUrl: '../../../../public/img/MobileGames/1646658238307.png'
  }, {
    title: '《幻塔》奈美西斯版本来袭，参与活动获得丰厚奖励',
    id: 4001,
    date: '2分钟前',
    tag: '手游资讯BOT',
    comment: 2347,
    imgUrl: '../../../../public/img/MobileGames/1646658241869.png'
  }, {
    title: '外服手游日报：《原罪战记》确定今年上半年推出！',
    id: 4002,
    date: '3分钟前',
    tag: '手游资讯BOT',
    comment: 1,
    imgUrl: '../../../../public/img/MobileGames/1646658246031.png'
  }, {
    title: '2021十大年度国家IP评选：米哈游包揽游戏前三',
    id: 4003,
    date: '5分钟前',
    tag: '手游资讯BOT',
    comment: 109,
    imgUrl: '../../../../public/img/MobileGames/1646658249447.png'
  }, {
    title: '《明日方舟》【活动奖励干员】见行者',
    id: 4004,
    date: '6分钟前',
    tag: '手游资讯BOT',
    comment: 43,
    imgUrl: '../../../../public/img/MobileGames/1646658252680.png'
  }, {
    title: '《赛马娘Pretty Derby》4th东京公演情报整理！',
    id: 4005,
    date: '7分钟前',
    tag: '手游资讯BOT',
    comment: 56,
    imgUrl: '../../../../public/img/MobileGames/1646658256337.png'
  }, {
    title: '《游戏王：决斗链接》主题卡组简介——魔导书',
    id: 4006,
    date: '9分钟前',
    tag: '手游资讯BOT',
    comment: 6,
    imgUrl: '../../../../public/img/MobileGames/1646658260106.png'
  },]
})
router.get('/nmobilegameart', (ctx, next) => {
  console.log('获取最新手机游戏文章');
  ctx.response.body = [{
    title: '【心-赏】 星季：梦想与希望的旅途，踏遍繁星与荒野',
    id: 4007,
    date: '1分钟前',
    tag: '手游资讯BOT',
    comment: 104,
    imgUrl: '../../../../public/img/MobileGames/1646658483675.png'
  }]
})

// Home动态页面
router.get('/friendavatar', (ctx, next) => {
  console.log('获取好友头像');
  ctx.response.body = [{
    userName: 'Simon',
    avatarUrl: '../../../public/img/AvatarImg/Simon.jpg'
  }, {
    userName: '幸福少年阿三',
    avatarUrl: '../../../public/img/AvatarImg/Asan.jpg'
  }, {
    userName: 'Charon',
    avatarUrl: '../../../public/img/AvatarImg/Charon.jpg'
  }, {
    userName: '白黎许',
    avatarUrl: '../../../public/img/AvatarImg/Akizuki Kanna.jpg'
  }, {
    userName: '白给上分',
    avatarUrl: '../../../public/img/AvatarImg/Leilei.jpg'
  }, {
    userName: '格奥尔基',
    avatarUrl: '../../../public/img/AvatarImg/other_01.jpg'
  }, {
    userName: '大大大薯条',
    avatarUrl: '../../../public/img/AvatarImg/other_02.jpg'
  }]
})
router.get('/dynamiclist', (ctx, next) => {
  console.log('获取Home动态页面动态List');
  ctx.response.body = [{
    id: 5001,
    avatarUrl: '../../../public/img/AvatarImg/Charon.jpg',
    userName: 'Charon',
    level: 14,
    time: '8分钟前',
    tag: 'PC游戏',
    thumbs: 20,
    comment: 55,
    contentTitle: 'Apex商店更新',
    contentText: '武器改色商店（？）R99核心碎片（范式转移换色）捆绑包30个箱子售价3590，单买1800暴走挺好看的🤩🤩，最后是30个箱子，开出了传家宝青春版😭',
    contentImgUrl: [
      '../../../public/img/HomeDynamic/1646806015853.png',
      '../../../public/img/HomeDynamic/1646806019516.png',
      '../../../public/img/HomeDynamic/1646806022968.png'
    ]
  }, {
    id: 5002,
    avatarUrl: '../../../public/img/AvatarImg/Akizuki Kanna.jpg',
    userName: '白黎许',
    level: 5,
    time: '10分钟前',
    tag: 'PC游戏',
    thumbs: 49,
    comment: 69,
    contentTitle: '宁姆格福全BOSS和赐福位置地图',
    contentText: '这是我自制的高清地图，如果有缺漏可以在评论区告诉我。铃珠猎人、黑夜骑兵和死之鸟只有晚上会出现。接下来的地图我做好后也会发出来。',
    contentImgUrl: ['../../../public/img/HomeDynamic/1646803335540.png']
  }, {
    id: 5003,
    avatarUrl: '../../../public/img/AvatarImg/Leilei.jpg',
    userName: '白给上分',
    level: 9,
    time: '12分钟前',
    tag: 'PC游戏',
    thumbs: 12,
    comment: 56,
    contentTitle: '论倒霉到底怎么治',
    contentText: '也玩了几年CSGO了，枪法可以练，道具可以练，那么倒霉属性怎么才能移除呀😭？几个人一起拉死的是我，隔着烟被混死的也是我（不止我一个在的情况下），不管对面什么枪，就能混死我。被180°转身一枪头的也是我，队友放点也是我被打侧身或者打屁股，架半天不拉，一拿道具就又人，要么就是拉出去没人，我都要退回去了对面拉出来了。。。',
    contentImgUrl: [
      '../../../public/img/HomeDynamic/1646806257423.png',
      '../../../public/img/HomeDynamic/1646806261264.png',
      '../../../public/img/HomeDynamic/1646806729028.png',
    ]
  }, {
    id: 5004,
    avatarUrl: '../../../public/img/AvatarImg/Simon.jpg',
    userName: 'Simon',
    level: 20,
    time: '13分钟前',
    tag: 'PC游戏',
    thumbs: 104,
    comment: 322,
    contentTitle: '暴走真的太好看了',
    contentText: '粉色涂装配上青色的光，真的太好看了家人们🥰',
    contentImgUrl: [
      '../../../public/img/HomeDynamic/1646806856900.png',
      '../../../public/img/HomeDynamic/1646806860725.png',
      '../../../public/img/HomeDynamic/1646806864492.png']
  }, {
    id: 5005,
    avatarUrl: '../../../public/img/AvatarImg/Asan.jpg',
    userName: '幸福少年阿三',
    level: 15,
    time: '15分钟前',
    tag: 'PC游戏',
    thumbs: 34,
    comment: 107,
    contentTitle: '4箱1红1金',
    contentText: '今天运气也太好了。🤣🤣🤣',
    contentImgUrl: [
      '../../../public/img/HomeDynamic/1646807132315.png',
      '../../../public/img/HomeDynamic/1646807135959.png',
      '../../../public/img/HomeDynamic/1646807139559.png']
  }]
})
router.get('/ndynamiclist', (ctx, next) => {
  console.log('获取Home动态页面最新动态List');
  ctx.response.body = [{
    id: 5006,
    avatarUrl: '../../../public/img/AvatarImg/other_01.jpg',
    userName: '格奥尔基',
    level: 16,
    time: '1分钟前',
    tag: 'PC游戏',
    thumbs: 3,
    comment: 7,
    contentTitle: 'cod解锁国区',
    contentText: '不懂就问，cod解锁国区是因为codol的下线吗',
    contentImgUrl: ['../../../public/img/HomeDynamic/1646802960111.png']
  }, {
    id: 5007,
    avatarUrl: '../../../public/img/AvatarImg/other_02.jpg',
    userName: '大大大薯条',
    level: 4,
    time: '1分钟前',
    tag: '主机游戏',
    thumbs: 1,
    comment: 3,
    contentTitle: '兄弟们剑盾和珍钻复刻哪个值得入手？玩完阿尔宙斯想玩别的宝可梦游戏，朱紫要等到年末太久了，想现在入手一个',
    contentText: '',
    contentImgUrl: []
  }]
})

module.exports = router